<template>
	<view class="groupList">
		<view class="detail">

			<view class="bottom">
				<view class="item" v-for="(item,index) in saleDetails" :key="index">
					<view class="item_left">
						<view class="view1">
							{{item.name}}
						</view>
						<view class="view2">
							{{item.createTime}}
						</view>
					</view>
					<view class="item_right">
						{{item.amout&&item.amout/100}}
					</view>
				</view>
				<view class="item_kong" v-if="isLastPage">
					已经到底了哦～
				</view>
			</view>
		</view>
	</view>
	</view>
</template>

<script>
	var app = getApp();
		import http from '@/utils/request/http.js';
	import {
		getSecKillList
	} from '../../apis/index.js';

	export default {
		data() {
			return {
				statusBarHeight: 0,
				windowHeight: 0,
				navBarHeight: 0,
				bottomTabbar: 0,
				menuButtonInfo: 0,
				navIndex: 0,
				mineInfo: {},
				phoneFlag: false,
				typeList: [],

				par: {
					page: 1,
					pageSize: 10,
				},
				saleDetails: [],
				isLastPage: false,
			}
		},
		onReady() {
			this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
			this.menuButtonInfo = uni.getMenuButtonBoundingClientRect();
			this.navBarHeight = uni.getMenuButtonBoundingClientRect().height + (uni.getMenuButtonBoundingClientRect().top -
				uni.getSystemInfoSync().statusBarHeight) * 2;
			this.windowHeight = uni.getSystemInfoSync().windowHeight;
			this.bottomTabbar = uni.getStorageSync('bottomTabbar');
			this.paddTop = this.statusBarHeight + this.navBarHeight
		},
		onLoad(options) {
			this.getSecKillData();
		},
		onShow() {
			
		},
		onReachBottom() {
			if (!this.isLastPage) {
				console.log(11)
				this.par.page++;
				this.getSecKillData();
			}
		},
		onShareAppMessage() {

		},
		methods: {
			getSecKillData() {
				let that = this;
				http.post('/api/platform/v1/sale/details',{
					page:that.par.page,
					pageSize:10
				}).then(res => { 
					this.saleDetails = this.par.page == 1 ? res.data.data : this.saleDetails.concat(res.data.data);
					this.isLastPage = res.data.is_last_page;
				})
			},
			
		}
	}
</script>

<style lang="scss">
	page {
		background: #F4F4F4;
	}

	.groupList {
		.bottom{
			width: 100%;
			margin-top: 32rpx;
			.item{
				padding: 0 25rpx;
				height: 110rpx;
				background: #FFFFFF;
				border-radius: 20rpx;
				display: flex;
				align-items: center;
				justify-content: space-between;
				margin-bottom: 24rpx;
				.item_left{
					.view1{
						font-size: 26rpx;
						font-family: PingFangSC-Regular, PingFang SC;
						font-weight: 400;
						color: #333333;
					}
					.view2{
						font-size: 24rpx;
						font-family: PingFangSC-Regular, PingFang SC;
						font-weight: 400;
						color: #999999;
						margin-top: 8rpx;
					}
				}
				.item_right{
					font-size: 30rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #333333;
				}
			}
		}
		.item_kong {
			display: flex;
			align-items: center;
			justify-content: center;
			font-size: 26rpx;
			padding: 20rpx 0 30rpx;
		}
	}
</style>
